<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2015-6-17
 * Time: 14:28
 */

namespace doumiaoduo\aliyun\actions;


use doumiaoduo\aliyun\OssuploaderHelper;
use yii\base\Action;
use yii\web\Response;

class UploadvideowechatAction extends Action{
    private $_config;

    public function init(){
        $this->_config=\Yii::$app->params['aliyunoss'];
        parent::init();
    }



    public function run(){
        \Yii::$app->response->format = Response::FORMAT_JSON;
        $config = array(
            "pathFormat" =>$this->_config['videoPathFormat'],//filePathFormat为"/uploadfiles/web/site/file/{yyyy}{mm}{dd}/{time}{rand:6}"
            "maxSize" => $this->_config['videoMaxSize'],
            "allowFiles" => $this->_config['videoAllowFiles']
        );
        $fieldName = $this->_config['videoFieldName'];
        $up=new OssuploaderHelper($fieldName,$config);
        $result = $up->getOssFileInfo();
        return $result;

    }

}